package cn.wolfcode.wolf2w.elasticsearch.service.impl;

import cn.wolfcode.wolf2w.elasticsearch.domain.UserInfoEs;
import cn.wolfcode.wolf2w.elasticsearch.repository.UserInfoEsRepository;
import cn.wolfcode.wolf2w.elasticsearch.service.IUserInfoEsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.data.mongodb.core.MongoTemplate;

import java.util.List;

@Service
public class UserInfoEsServiceImpl implements IUserInfoEsService {

    @Autowired
    private UserInfoEsRepository userInfoEsRepository;

    @Override
    public void save(UserInfoEs userInfoEs) {
        userInfoEsRepository.save(userInfoEs);
    }

    @Override
    public void delete(String id) {
        userInfoEsRepository.deleteById(id);
    }

    @Override
    public void update(UserInfoEs userInfoEs) {
        userInfoEsRepository.save(userInfoEs);
    }

    @Override
    public UserInfoEs get(String id) {
        return userInfoEsRepository.findById(id).orElse(null);
    }

    @Override
    public List<UserInfoEs> list() {
        return null;
    }
}
